#! /usr/bin/env octave -q
train=importdata('../data/mine/random_liner.csv', ',')
sample_size = size(train,1)
x=train(:,1)
y=train(:,2)
ex=[ones(sample_size,1), x, x.*x, x.*x.*x]
#ang=(x'*x)^-1*x'*y
ang=(ex'*ex)^-1*ex'*y
ang=ang'
base=(0:1:300)'
base2=base.*base
base3=base2.*base

head=ones(size(base), 1)
pt=[head, base, base2, base3]
target=ang*pt'


#y = a1 +a2*x
plot(x,y,'*', base, target)
pause
